package com.room.room.service.impl;

import com.project.utils.PageUtils;
import com.project.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import com.room.room.dao.HouseCollectDao;
import com.room.room.entity.HouseCollectEntity;
import com.room.room.service.HouseCollectService;


@Service("houseCollectService")
public class HouseCollectServiceImpl extends ServiceImpl<HouseCollectDao, HouseCollectEntity> implements HouseCollectService {
    @Autowired
    private HouseCollectDao houseCollectDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<HouseCollectEntity> page = this.page(
                new Query<HouseCollectEntity>().getPage(params),
                new QueryWrapper<HouseCollectEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public HouseCollectEntity findByHouse(String secondaryName) {
        return houseCollectDao.findByHouse(secondaryName);
    }

}